package com.itheima.property;

import java.util.Map;
import java.util.Properties;

/*
Properties 使用
 */
public class Demo01 {

    public static void main(String[] args) {
        Properties map = new Properties();
        //        //增
        map.put("马蓉","王宝强");
        map.put("关晓彤","鹿晗");
        map.put("唐艺昕","张若昀");
        System.out.println(map);

       //删
        map.remove("马蓉");
        System.out.println(map);

        //改
        map.replace("关晓彤","吴亦凡");
        System.out.println(map);
        //查
         System.out.println(map.get("唐艺昕"));
        //遍历
     for (Object o : map.keySet()) {
            System.out.println(o+"~~~~"+map.get(o));
        }
        for (Map.Entry<Object, Object> entry : map.entrySet()) {
            System.out.println(entry.getKey()+"|||||"+entry.getValue());
        }
        map.forEach((Object k,Object v)->
            System.out.println(k+"====="+v)
        );


    }
}
